package com.chenfei.page.controller;

import com.chenfei.page.domain.Test;
import com.chenfei.page.service.PageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping(value = "/page")
@Slf4j
@Api(value = "分页",description="分页")
public class PageController {
    @Autowired
    PageService pageService;

    @ApiOperation(value = "获取分页数据", httpMethod = "GET")
    @ApiResponse(code = 200, message = "success")
    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public List<Test> listsPage(int currentPage, int pageSize) {
        return pageService.findTestByPage(currentPage, pageSize);
    }
}
